//
//  AboutUsViewController.m
//  Double
//
//  Created by dllo on 15/5/25.
//  Copyright (c) 2015年 李响. All rights reserved.
//

#import "AboutUsViewController.h"

@interface AboutUsViewController ()

@end

@implementation AboutUsViewController

- (void)dealloc
{
    [super dealloc];
}
- (instancetype)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil
{
    self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil];
    if (self) {
    }
    return self;
}
- (void)viewDidLoad {
    [super viewDidLoad];
    self.view.backgroundColor = [UIColor colorWithRed:0.84 green:1.00 blue:0.77 alpha:1.0];
}
- (void)loadView
{
    [super loadView];
    self.navigationItem.title = @"关于我们";
    [self.view setBackgroundColor:[UIColor whiteColor]];
    [self createView];
    self.navigationItem.leftBarButtonItem = [[UIBarButtonItem alloc] initWithImage:[UIImage imageNamed:@"fanhui.png"] style:UIBarButtonItemStylePlain target:self action:@selector(leftbuttonAction)];
}
- (void)leftbuttonAction
{
    [self.navigationController popViewControllerAnimated:YES];
}

#pragma mark 关于我们界面
- (void)createView
{
    UIImageView * ImageView = [[UIImageView alloc]initWithFrame:CGRectMake([UIScreen mainScreen].bounds.size.width / 4, 80, [UIScreen mainScreen].bounds.size.width / 2, [UIScreen mainScreen].bounds.size.width / 2)];
    [ImageView setImage:[UIImage imageNamed:@"0.png"]];
    [self.view addSubview:ImageView];
    
    
    CAAnimationGroup * group = [CAAnimationGroup animation];
    [group setDuration:1.5];
    [group setAutoreverses:YES];
    [group setRepeatCount:INFINITY];
    NSMutableArray * array = [NSMutableArray array];
    CABasicAnimation * first = [CABasicAnimation animationWithKeyPath:@"position"];
    NSValue * from = [NSValue valueWithCGPoint:CGPointMake(100, 100)];
    NSValue * to = [NSValue valueWithCGPoint:CGPointMake(50, 50)];
    [first setFromValue:from];
    [first setToValue:to];
    
    CABasicAnimation * second = [CABasicAnimation animationWithKeyPath:@"position"];
    NSValue * from2 = [NSValue valueWithCGPoint:CGPointMake(120, 120)];
    NSValue * to2 = [NSValue valueWithCGPoint:CGPointMake(200, 200)];
    [second setFromValue:from2];
    [second setToValue:to2];
    
    [array addObject:first];
    [array addObject:second];
    group.animations = array;
    [ImageView.layer addAnimation:group forKey:@""];
    [ImageView setFrame:CGRectMake(180, 180, 200, 200)];
    [ImageView.layer setCornerRadius:100];
    // 允许内切
    [ImageView.layer setMasksToBounds:YES];
    
    
    UILabel * Label = [[UILabel alloc]initWithFrame:CGRectMake(50, [UIScreen mainScreen].bounds.size.height / 2 - 50, [UIScreen mainScreen].bounds.size.width - 100, [UIScreen mainScreen].bounds.size.height / 2 - 80)];
//    Label.layer.borderWidth = 2;
    Label.layer.cornerRadius = 20;
    [self.view addSubview:Label];
    UILabel * NameLabel = [[UILabel alloc]initWithFrame:CGRectMake(0, 0, Label.frame.size.width, 30)];
    [NameLabel setText:@"蘑菇电台"];
    [NameLabel setTextAlignment:NSTextAlignmentCenter];
    [Label addSubview:NameLabel];
    
    
    UILabel * WebsiteLabel = [[UILabel alloc]initWithFrame:CGRectMake(0, 20, Label.frame.size.width, 60)];
    [WebsiteLabel setText:@"官方网站:http://user.qzone.qq.com/811400344/profile/permit"];
    WebsiteLabel.numberOfLines = 0;
    [WebsiteLabel setFont:[UIFont systemFontOfSize:12]];
    [WebsiteLabel setTextAlignment:NSTextAlignmentCenter];
    [Label addSubview:WebsiteLabel];
    
    UILabel * QQGroupLabel = [[UILabel alloc]initWithFrame:CGRectMake(0, 60, Label.frame.size.width, 30)];
    [QQGroupLabel setText:@"开发者QQ:811400344"];
    [QQGroupLabel setFont:[UIFont systemFontOfSize:12]];
    [QQGroupLabel setTextAlignment:NSTextAlignmentCenter];
    [Label addSubview:QQGroupLabel];
    
    UILabel * MicroblogLabel = [[UILabel alloc]initWithFrame:CGRectMake(0, 80, Label.frame.size.width, 30)];
    [MicroblogLabel setText:@"微信号:811400344"];
    [MicroblogLabel setFont:[UIFont systemFontOfSize:12]];
    [MicroblogLabel setTextAlignment:NSTextAlignmentCenter];
    [Label addSubview:MicroblogLabel];
    
    UILabel * WeiXinLabel = [[UILabel alloc]initWithFrame:CGRectMake(0, 100, Label.frame.size.width, 30)];
    [WeiXinLabel setText:@"微博号:此城飘雪"];
    [WeiXinLabel setFont:[UIFont systemFontOfSize:12]];
    [WeiXinLabel setTextAlignment:NSTextAlignmentCenter];
    [Label addSubview:WeiXinLabel];
    
    UILabel * aboutUs1 = [[UILabel alloc]initWithFrame:CGRectMake(0, 130, Label.frame.size.width / 2, 30)];
    [aboutUs1 setText:@"开发人员: "];
    [aboutUs1 setFont:[UIFont systemFontOfSize:12]];
    [aboutUs1 setTextAlignment:NSTextAlignmentCenter];
    [Label addSubview:aboutUs1];
    
    UILabel * aboutUs2 = [[UILabel alloc]initWithFrame:CGRectMake( Label.frame.size.width / 2 - 25, 130, Label.frame.size.width, 30)];
    [aboutUs2 setText:@"  马旭东 "];
    [aboutUs2 setFont:[UIFont systemFontOfSize:12]];
    [Label addSubview:aboutUs2];
    
    UILabel * aboutUs3 = [[UILabel alloc]initWithFrame:CGRectMake(0, 150, Label.frame.size.width, 30)];
    [aboutUs3 setText:@"李 响"];
    [aboutUs3 setFont:[UIFont systemFontOfSize:12]];
    [aboutUs3 setTextAlignment:NSTextAlignmentCenter];
    [Label addSubview:aboutUs3];
    UILabel * aboutUs4 = [[UILabel alloc]initWithFrame:CGRectMake(0, 170, Label.frame.size.width, 30)];
    [aboutUs4 setText:@"孙尚君"];
    [aboutUs4 setFont:[UIFont systemFontOfSize:12]];
    [aboutUs4 setTextAlignment:NSTextAlignmentCenter];
    [Label addSubview:aboutUs4];

    [aboutUs1 release];
    [aboutUs2 release];
    [aboutUs3 release];
    [aboutUs4 release];
    [ImageView release];
    [Label release];
    [NameLabel release];
    [WebsiteLabel release];
    [QQGroupLabel release];
    [MicroblogLabel release];
    [WeiXinLabel release];
}
- (void)viewWillAppear:(BOOL)animated
{
    self.navigationController.navigationBar.hidden = NO;
    self.tabBarController.tabBar.hidden = YES;
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
